package com.stlm2.util;

import com.stlm2.dataSource.DBContextHolder;
import org.apache.commons.lang.math.NumberUtils;

/**
 * Author：zlq
 * Date：2017/12/12
 * Description：
 */
public class DataSourceURLUtil {
    public static Boolean changeDataSource(String url){
        if(url.equals("http://crm.chinaddcat.com/")){
            DBContextHolder.setDBType(DBContextHolder.masterData);
            return true;
        }
        if(url.equals("http://yccrm.chinaddcat.com/")){
            DBContextHolder.setDBType(DBContextHolder.yongChengData);
            return true;
        }
        if(url.equals("http://xtdcrm.chinaddcat.com/")){
            DBContextHolder.setDBType(DBContextHolder.xtdData);
            return true;
        }
        if(url.equals("http://localhost/")){
//            DBContextHolder.setDBType(DBContextHolder.xtdData);
            return true;
        }
        return true;

    }
}
